<?php
global $MONTHS2, $TYPE_MAVRO, $VALUTA;
?>

<script language="javascript" src='<?=config_item('js_path')?>js/bonus_reg.js?<?=time()?>'></script>
<script language="javascript">

var kurses = <?=json_encode($kurses);?>;
var users_l = <?=json_encode($users_l);?>;
var users_d = <?=json_encode($users_date);?>;

$(document).ready(function(){
	countMavroReg();
});

</script>


<h1>Добавление бонуса за регистрацию</h1>

<form method=post action='oper/save_bonus_reg' enctype='multipart/form-data' id='f'>
	<table class='edit' cellspacing=0>
		<tr>
			<td>Участник</td>
			<td><select name='user_id' onchange="countMavroReg();">
				<option value='0'> </option>
				<?php foreach($users as $u) { ?>
					<option value='<?php echo $u['id']?>'><?php echo $u['fio']?> (<?=$u['email']?>)</option>
				<?php } ?>
			</select></td>
		</tr>
		<tr>
			<td>Дата</td>
			<td><input type='text' readonly name='date' value='' style="border:0px; width:100px;"></td>
		</tr>
		<tr>
			<td>Сумма:</td>
			<td><input type='text' readonly name='summ' value='20$' style="border:0px; width:100px;"></td>
		</tr>
		<tr>
			<td>Тип мавро:</td>
			<td><select name='mavro_type_buy' onchange="countMavroReg()">
				<?php foreach($TYPE_MAVRO as $k => $v) {
					if($k == 'week') continue;
					?>
					<option value='<?=$k?>'><?=$v?></option>
				<?php } ?>
			</select> <input type='checkbox' name='sverh' value='1' onchange="countMavroReg()"> Сверхдоходные</td>
		</tr>
		<tr>
			<td>Курс:</td>
			<td><input type='text' readonly name='kurs' value='' style="border:0px; width:70px;"></td>
		</tr>
		<tr>
			<td>Курс валюты:</td>
			<td>
				<input type='text' readonly name='kurs_valuta' value='' class='noborder' style="width:100px;" onchange="chKursValuta(this)" onkeyup="chKursValuta(this)">
				<span id='kurs_valuta_reverse' style="display:none;"><input type='checkbox' name='kurs_valuta_reverse' value='1' onchange="changeKursValutaReverse(this)"> Обратный курс</span>
			</td>
		</tr>
		<tr>
			<td>Мавро:</td>
			<td>
				<input type='text' readonly name='mavro' style="border:0px; width:70px;">
				<select name='mavro_valuta' onchange="countMavroReg()">
					<?php foreach($VALUTA as $k => $v) { if($k == 'THB') continue; ?>
						<option value='<?=$k?>' <?php if($k == '$') echo "selected"; ?>><?=$v?></option>
					<?php } ?>
				</select> <input type='text' readonly name='mavro_percent' value='' style="border:0px; border;0px; width:70px;"> 
			</td>
		</tr>
	</table>
	<br>
	<input type='submit' value='Сохранить' name='subm'>

</form>